﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Learn.NewFolder1_and_SavingData
{
    public class Task
    {
        public string title { get; set; }
        public bool isDone { get; set; }
    }
    public partial class a : System.Web.UI.Page
    {
        public string Cmd { get { return Request.QueryString["cmd"]; } }
        System.Web.Script.Serialization.JavaScriptSerializer ser = new System.Web.Script.Serialization.JavaScriptSerializer();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Cmd == "getTaskLs")
            {
                var ls = new List<Task>(){
                    new Task{ title="title0", isDone=false},
                    new Task{ title="title1", isDone=true},
                };
                Response.Clear();
                Response.Write(ser.Serialize(ls));
                Response.End();
            }
            else if (Cmd=="save")
            {
                var form = Request.Form["data"];
            }
        }
    }
}